 /// @file ExchangeTopoShape.h
 /// @brief ExchangeTopoShape 
 /// @createtime 2025-05-28

#ifndef EXCHANGETOPOSHAPE_H
#define EXCHANGETOPOSHAPE_H

#include "topology/TopoShape.hpp"
#include "ExchangeMatrix.h"

namespace  AMCAX::Exchange {

class ExchangeTopoShape{

public:
    ExchangeTopoShape(const AMCAX::TopoShape & s)
    : shape_(s)
    {

    }

    AMCAX::TopoShape GetShape(){
        return shape_ ;
    }

    void ApplyTransfrom(const AMCAX::Exchange::ExchangeMatrix &matrix){
        if(!shape_.IsNull())
        {
            AMCAX::Transformation3 transform;
            auto orientation = matrix.GetOrientation();
            auto origin = matrix.GetOrigin();
            transform.SetValues(
                orientation[0][0], orientation[0][1], orientation[0][2], origin[0],
                orientation[1][0], orientation[1][1], orientation[1][2], origin[1],
                orientation[2][0], orientation[2][1], orientation[2][2], origin[2]);
            
            AMCAX::TopoLocation loc(transform);
            shape_.SetLocation(loc, false);
        }
    }
private:
    AMCAX::TopoShape shape_;

} ;

} ;

#endif